#ifndef SRC_BIN_PG_BASEBACKUP_RECEIVELOG_H
#define SRC_BIN_PG_BASEBACKUP_RECEIVELOG_H
#include "access/xlogdefs.h"

namespace Spq {

/*
 * Called before trying to read more data or when a segment is
 * finished. Return true to stop streaming.
 */
typedef bool (*stream_stop_callback)(XLogRecPtr segendpos, uint32 timeline,
                                     bool segment_finished, XLogRecPtr endPos);

bool ReceiveXlogStream(PGconn* conn, XLogRecPtr startpos, uint32 timeline,
                       const char* sysidentifier, const char* basedir,
                       stream_stop_callback stream_stop, XLogRecPtr* endPos,
                       int standby_message_timeout_local, bool rename_partial);

}  // namespace Spq

#endif  // SRC_BIN_PG_BASEBACKUP_RECEIVELOG_H